/**
 * Created by WU on 2016/9/7.
 */
$(function () {
    $('#login_form').submit(function () {
        $.ajax({
            type:'post',
            url:'/login',
            data:$('#login_form').serialize(),
            dataType:'json',
                    success:function (data) {
                        if(data.res==1){
                            location.href='/article';
                }else if(data.res==0){
                    location.href='/error';
                }
            },
            error:function (error) {
                alert(error.message)

            }

        });
        return false;
    });

});